﻿using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using OfficeOpenXml.Table;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ZhonTai.Industry.Services.WorkOrder.Dto.Output
{
    [ExcelExporter(Name = "工单列表", TableStyle = TableStyles.Light9, AutoFitAllColumn = true, AutoFitMaxRows = 5000)]
    public class WorkOrderExport
    {
        /// <summary>
        /// ID
        /// </summary>
        [ExporterHeader(DisplayName = "工单序号", Format = "0", ColumnIndex = 1)]
        public long Id { get; set; }

        /// <summary>
        /// 工单编号
        /// </summary>
        /// <remarks>订单编号</remarks>
        [ExporterHeader(DisplayName = "工单编号", ColumnIndex = 2)]
        public string? OrderCode { get; set; }

        /// <summary>
        /// 工单名称
        /// </summary>
        /// <remarks>工单名称</remarks>
        [ExporterHeader(DisplayName = "工单名称", ColumnIndex = 3)]
        public string? OrderName { get; set; }

        /// <summary>
        /// 产品编码
        /// </summary>
        /// <remarks>产品编码</remarks>
        [ExporterHeader(DisplayName = "产品编码", ColumnIndex = 4)]
        public string? ProductCode { get; set; }

        /// <summary>
        /// 产品名称
        /// </summary>
        /// <remarks>产品名称</remarks>
        [ExporterHeader(DisplayName = "产品名称", ColumnIndex = 5)]
        public string? ProductName { get; set; }

        /// <summary>
        /// 计划数量
        /// </summary>
        /// <remarks>计划数量</remarks>
        [ExporterHeader(DisplayName = "计划数量", Format = "0", ColumnIndex = 6)]
        public int PlanCount { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        /// <remarks>排序</remarks>
        [ExporterHeader(DisplayName = "排序", Format = "0", ColumnIndex = 7)]
        public int Sort { get; set; }

        /// <summary>
        /// 完成数量
        /// </summary>
        /// <remarks>成功数量</remarks>
        [ExporterHeader(DisplayName = "完成数量", Format = "0", ColumnIndex = 8)]
        public int SuccessCount { get; set; }

        /// <summary>
        /// 失败数量
        /// </summary>
        /// <remarks>失败数量</remarks>
        [ExporterHeader(DisplayName = "失败数量", Format = "0", ColumnIndex = 9)]
        public int FailCount { get; set; }

        /// <summary>
        /// 未下线数量
        /// </summary>
        /// <remarks>未下限数量</remarks>
        [ExporterHeader(DisplayName = "未下线数量", Format = "0", ColumnIndex = 10)]
        public int OnLineCount { get; set; }

        /// <summary>
        /// 计划开始时间
        /// </summary>
        /// <remarks>计划开始时间</remarks>
        [ExporterHeader(DisplayName = "计划开始时间", Format = "yyyy-MM-dd HH:mm:ss", ColumnIndex = 11)]
        public DateTime PlanStartDate { get; set; }

        /// <summary>
        /// 计划结束时间
        /// </summary>
        /// <remarks>计划结束时间</remarks>
        [ExporterHeader(DisplayName = "计划结束时间", Format = "yyyy-MM-dd HH:mm:ss", ColumnIndex = 12)]
        public DateTime PlanEndDate { get; set; }

        /// <summary>
        /// 实际开始时间
        /// </summary>
        /// <remarks>实际开始时间</remarks>
        [ExporterHeader(DisplayName = "实际开始时间", Format = "yyyy-MM-dd HH:mm:ss", ColumnIndex = 13)]
        public DateTime? ActualStartDate { get; set; }

        /// <summary>
        /// 实际结束时间
        /// </summary>
        /// <remarks>实际结束时间</remarks>
        [ExporterHeader(DisplayName = "实际结束时间", Format = "yyyy-MM-dd HH:mm:ss", ColumnIndex = 14)]
        public DateTime? ActualEndDate { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        /// <remarks>状态</remarks>
        [ExporterHeader(DisplayName = "状态", Format = "0", ColumnIndex = 15)]
        public int State { get; set; } = 0;

        /// <summary>
        /// 描述
        /// </summary>
        [ExporterHeader(DisplayName = "描述", ColumnIndex = 16)]
        public string? Description { get; set; }
    }
}